package com.example.gulimall.product.web;

import com.example.gulimall.product.service.SkuInfoService;
import com.example.gulimall.product.vo.item.SkuItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * <p>
 *
 * </p>
 *
 * @author zyred
 * @since v 0.1
 **/
@Controller
public class ItemController {

    @Autowired private SkuInfoService skuInfoService;

    @GetMapping("{skuId}.html")
    public String item (@PathVariable("skuId") Long skuId, Model model) {
        SkuItemVo skuItemVo = this.skuInfoService.itemPlus(skuId);
        model.addAttribute("item", skuItemVo);
        return "item";
    }



}
